package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

public class OSWDemo {
    public static void main(String[] args) throws IOException {

        FileOutputStream fos = new FileOutputStream("./test./osw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);

        String line = "大家早上好";

        osw.write(line);
        osw.write("\n我是刘德华\nsdsadfzdfgdsdsdsd大收得到");

        System.out.println("写出完毕");
        osw.close();
    }
}
